<?php
class RegistryController extends Zend_Controller_Action {
	
	private $log;
	private $registry;
	
	public function init() {
	$this->log = Zend_Registry::get('log');
	$this->registry = new Macys_Api_V2_Registry();
	}
	
	public function getregistryAction() {
		//var_dump($this->registry->getRegistry());
		$this->view->display = $this->registry->getRegistry(); 
		$this->render('user/getdetail', null, true);
		 
		//$this->getHelper('viewRenderer')->setNoRender();
	}
	
	/**
	 * This Logins the User get the Registry ID from there and 
	 * queries the Registry BVR view by Default
	 * Enter description here ...
	 */
	public function getregistrybyidAction() {
		// by Default does BVR View of Registry
		var_dump($this->registry->getRegistryById());
		$this->getHelper('viewRenderer')->setNoRender();
	}
	
	public function createregistryAction() {
		var_dump($this->registry->createRegistry());
		$this->getHelper('viewRenderer')->setNoRender();
	}
	
	public function additemAction() {
		$data = '{"itemsMapper": [{"upcNumber": 21614053282, "qtyRequested": 1}]}';
		$this->registry->addItems($data);
		$this->getHelper('viewRenderer')->setNoRender();
	}
}